<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Home In Manchester</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description_mc" content="">
<meta name="author" content="">

<!-- Le styles -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="assets/css/docs.css" rel="stylesheet">
<link href="assets/js/google-code-prettify/prettify.css"
	rel="stylesheet">

<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="assets/js/html5shiv.js"></script>
    <![endif]-->

<style>
body {
	font-family: 微软雅黑;
	font-size: 14px;
}

.nav-list {
	margin-top: 0px;
}
h4{
	margin-top:25px;
}
</style>
</head>

<body data-spy="scroll" data-target=".bs-docs-sidebar">

	<!-- Navbar
    ================================================== -->
	<div class="navbar navbar-inverse navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<button type="button" class="btn btn-navbar" data-toggle="collapse"
					data-target=".nav-collapse">
					<span class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<div class="nav-collapse collapse">
					<ul class="nav">
						<li class="active"><a href="index.html">首页</a></li>
						<li class=""><a href="live.html">生活信息</a></li>
						<li class=""><a href="func.html">实用功能</a></li>
						<li class=""><a href="forum.html">娱乐交友</a></li>
						<li class=""><a href="study.html">学术讨论</a></li>
						<li class=""><a href="member.html">会员管理</a></li>
						<li class=""><a href="bookFood.html">订餐系统</a></li>
						<li class=""><a href="ticket.html">票务系统</a></li>
						<li class=""><a href="coupon.html">优惠券</a></li>
						<li class=""><a href="readme.html">补充说明</a></li>
						<li class=""><a href="extend.html">扩展功能</a></li>
						<li class=""><a href="advert.html">广告</a></li>
						<li class=""><a href="report.html">公告系统</a></li>
						<li class=""><a href="radio.html">电台系统</a></li>
					</ul>
				</div>
			</div>
		</div>
	</div>

	<!-- Subhead
================================================== -->
	<header class="jumbotron subhead" id="overview">
		<div class="container">
			<h1>客户端接口调用指南</h1>
			<p class="lead">web客户端、移动客户端获取和设置服务器数据的统一接口访问规范。符合restful的api设计范式，提供跨平台的基于http协议的一致web接口。</p>
		</div>
	</header>


	<div class="container">

		<!-- Docs nav
    ================================================== -->
		<div class="row">
			<div class="span3 bs-docs-sidebar">
				<h3>API文档</h3>
				<ul class="nav nav-list bs-docs-sidenav">
					<li><a href="#api-nav"><i class="icon-chevron-right"></i>
							API导航图</a></li>
					<li><a href="#api-call"><i class="icon-chevron-right"></i>
							API调用说明</a></li>
					<li><a href="#api-test"><i class="icon-chevron-right"></i>
							API调用测试</a></li>
				</ul>

			</div>
			<div class="span9">



				<!-- API 导航图
        ================================================== -->
				<section id="api-nav">
					<div class="page-header">
						<h1>API导航图</h1>
					</div>


				</section>



				<!-- API 调用说明
        ================================================== -->
				<section id="api-call">
					<div class="page-header">
						<h1>API调用说明</h1>
					</div>
					<h3>请求URL说明</h3>
					<p>http://[域名]/[api_name] </p>
					
					<h4>域名和IP的说明：</h4>
					<p>正式环境下请使用域名：http://www.家在曼城.com。测试环境下使用：http://115.29.250.136:8080/homeInManchester。</p>
					<code>http://115.29.250.136:8080/homeInManchester 是家在曼城项目的正式服务器。</code>
					
					<h4>api_name的说明：</h4>
					<p>[api_name]：为各个模块的具体使用接口，如访问家在曼城项目的会员列表：api/members</p>
					
					<h4>请求URL的示例：</h4>
					<p>测试环境下访问 系统的会员列表：</p>
					<code>http://115.29.250.136:8080/homeInManchester/api/members </code>
					<br></br>
					<h3>API超时时间说明</h3>
					<p>API一般会在50ms以内返回数据，API接口服务设置的最长超时时间为3s。</p>
					<p>开发者可以根据上述说明自行设置API调用的超时时间。 </p>
					
					<br>
					
					<h3 id="public_args">公共参数说明</h3>
					<table class="table table-bordered">
						<thead>
							<tr>
								<th width="100">参数名称</th>
								<th width="100">是否必须</th>
								<th width="100">类型</th>
								<th>描述</th>
							</tr>
						</thead>
						<tbody>
						<tr>
							<td>format</td>
							<td></td>
							<td>String</td>
							<td>定义API返回的数据格式。
取值说明：为xml时表示返回的格式是xml；为json时表示返回的格式是json。
注意：json、xml为小写，否则将不识别。format不传或非xml，则返回json格式数据。目前我们系统只支持json格式</td>
						</tr>
						</tbody>
						
					</table>
					
					<h3 >公共返回参数说明</h3>
					<table class="table table-bordered">
						<thead>
							<tr>
								<th width="100">参数名称</th>
								<th>描述</th>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td>code</td>
								<td>返回状态码。具体含义参考下文《返回码说明》</td>
							</tr>
							<tr>
								<td>msg</td>
								<td>如果错误，返回错误信息。</td>
							</tr>
						</tbody>
					</table>
					
					<h3 id="public-code">返回码说明</h3>
					<h4>总体说明：</h4>
					<p><code>code = 0</code>:正确返回</p>
					<p><code>code > 0</code>:调用API时，发生错误，需要开发者进行处理</p>
					<p>目前代码表还不完全，实际开发中会不断更新此处内容。</p>
					
					<table class="table table-bordered">
						<thead>
							<tr>
								<th width="100">错误码</th>
								<th>含义说明</th>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td>100</td>
								<td>请求参数错误</td>
							</tr>
							<tr>
								<td>101</td>
								<td>必填参数错误，请开发者参考API说明文档检查。</td>
							</tr>
							<tr>
								<td>102</td>
								<td>参数格式错误，请开发者参考API说明文档检查。</td>
							</tr>
							<tr>
								<td>1000</td>
								<td>网络错误，http请求异常。</td>
							</tr>
							<tr>
								<td>1001</td>
								<td>系统级错误，请联系服务器管理员。</td>
							</tr>
						</tbody>
					</table>
				</section>

				<!-- API 调用测试
        ================================================== -->
				<section id="api-test">
					<div class="page-header">
						<h1>API调用测试</h1>
					</div>
					<h3>测试API：</h3>
					<code>http://115.29.250.136:8080/homeInManchester/api/test</code>
					<p>请求方式：get</p>
					<p>返回类型：json</p>
					<h3>正确返回结果：</h3>
					<pre>
[
    {
        "testId": 1, 
        "testString": "这里是测试文本", 
        "testText": "&lt;h2&gt;这里是带html标记的文本&lt;/h2&gt;"
    }, 
    {
        "testId": 2, 
        "testString": "这里是测试文本2", 
        "testText": "&lt;h2>这里是带html标记的文本2&lt;/h2&gt;"
    }
]

					</pre>
				</section>

			</div>
		</div>

	</div>



	<!-- Footer
    ================================================== -->
	<footer class="footer">
		<div class="container">
			<p>
				Designed and built with all the love in the world by <a
					href="http://www.hcrazy.com" target="_blank">@hsmart</a>
			</p>
			<ul class="footer-links">
				<li><a href="http://www.hcrazy.com">Blog</a></li>
				<li class="muted">&middot;</li>
				<li><a href="http://www.hcrazy.com">Issues</a></li>
				<li class="muted">&middot;</li>
				<li><a href="http://www.hcrazy.com">Changelog</a></li>
			</ul>
		</div>
	</footer>



	<!-- Le javascript
    ================================================== -->
	<!-- Placed at the end of the document so the pages load faster -->
	<script src="assets/js/jquery.js"></script>
	<script src="assets/js/bootstrap-transition.js"></script>
	<script src="assets/js/bootstrap-alert.js"></script>
	<script src="assets/js/bootstrap-modal.js"></script>
	<script src="assets/js/bootstrap-dropdown.js"></script>
	<script src="assets/js/bootstrap-scrollspy.js"></script>
	<script src="assets/js/bootstrap-tab.js"></script>
	<script src="assets/js/bootstrap-tooltip.js"></script>
	<script src="assets/js/bootstrap-popover.js"></script>
	<script src="assets/js/bootstrap-button.js"></script>
	<script src="assets/js/bootstrap-collapse.js"></script>
	<script src="assets/js/bootstrap-carousel.js"></script>
	<script src="assets/js/bootstrap-typeahead.js"></script>
	<script src="assets/js/bootstrap-affix.js"></script>

	<script src="assets/js/holder/holder.js"></script>
	<script src="assets/js/google-code-prettify/prettify.js"></script>

	<script src="assets/js/application.js"></script>



</body>
</html>
